Use of large objects (LOBs) in relational databases is well known. LOBs are a set of datatypes that are designed to hold very large amounts of text or binary (raw) data. With current technology, a LOB can hold up to a maximum size ranging from 8 terabytes to 128 terabytes depending on how a database is configured. For more information on LOBs, see, e.g. Oracle Database Application Developer's Guide—Large Objects 10 g Release 2 (10.2), Part No. B14249-01, published in 2005 that is incorporated by reference herein in its entirety as background. Also see Oracle Database PL/SQL Packages and Types Reference, 10 g Release 2 (10.2), Part No. B14258-01, published in 2005 which is also incorporated by reference herein in its entirety as background. As described in such documentation, an XML document can be stored unparsed (as a character or byte sequence of unknown structure) in a LOB column of a database.
U.S. Pat. No. 5,999,943 is hereby incorporated by reference herein in its entirety as background. This patent teaches performing operations on large objects (LOBs) in a database. In such a prior art system, a server computer 10 (FIG. 1) receives from a client computer 20 a command (or query) to be performed on a relational database. The command typically identifies a row of a table (e.g. based on user input). The table in the database includes a column that contains LOBs. Server computer 10 is typically programmed with software (e.g. supporting PL/SQL) to respond by sending to client computer 20 a first set of data from the row in the database. The first set of data includes a locator for a LOB that belongs in the LOB column of the identified row. The locator includes a LOB identifier that uniquely identifies the LOB, and snapshot information that identifies a particular version of the LOB. Thereafter, server 10 may receive from client 20 a request to perform an operation on the LOB. The request may be made in conformance with an application programming interface (LOB API) that requires passing the locator for the LOB to server 10. Server 10 performs the requested operation on the particular version of the LOB that is identified in snapshot information contained in the locator passed to server 10 by client 20.
Changes made in response to an update to a particular LOB chunk by server 10 are illustrated on the right side of FIG. 1, by use of an apostrophe after a reference numeral. In the illustrated example of FIG. 1, a LOB chunk of a LOB with a lobid “LOBID2” is updated by server 10 while performing the above-described operation. By traversing a LOB index built on the column that contains the LOB, an appropriate index entry 104 associated with LOBID2 is found. The index entry 104 includes a pointer 112 that indicates that a chunk block 106 within LOB data storage 102 is the most current version to be updated.
According to U.S. Pat. No. 5,999,943, to perform a LOB operation, server 10 reads a current version of data from a LOB's chunk, from chunk block 106 identified by the pointer 112, followed by modification of the data in volatile memory, and followed by storing back to a different location 108 in LOB data storage 102. A pointer 112 in index entry 104 is modified by server 10 to point to chunk block 108 containing the updated version of the LOB. Because pointer 112 is updated to be new pointer 112′, the next time index entry 104 is used to access that particular data, the updated version of the data is accessed at chunk block 108, rather than an old version of the data that remains in chunk block 106.
A similar system is disclosed in U.S. Pat. No. 6,738,790 granted to Klein et al. that is directed to accessing a large object that belongs to a cell in a table. See also U.S. Pat. No. 6,836,778 that describes storing XML documents as LOBs in a database. Both these patents are incorporated by reference herein in their entirety as background.
To the inventors' knowledge, prior art related to LOB operations requires that everything after a portion that is modified in a LOB needs to be rewritten if the modified portion is larger than the original portion. Therefore, the inventors find it desirable to improve the operations related to changing of a LOB whose structure is not known.